//
//  HBQsmHeadView.m
//  HelloBeeQuick
//
//  Created by 李建强 on 16/8/20.
//  Copyright © 2016年 LiYiLin. All rights reserved.
//

#import "HBQsmHeadView.h"

#import "HBQsmListModel.h"
@interface HBQsmHeadView()

@property (nonatomic,strong)UIView *floatView;

@property (nonatomic,strong)UILabel *floatLabel;

@end


@implementation HBQsmHeadView


-(UILabel *)floatLabel{
    if (_floatLabel == nil) {
        
        _floatLabel = [[UILabel alloc]initWithFrame:CGRectZero];
        _floatLabel.font = [UIFont systemFontOfSize:12];
    }
    
    return _floatLabel;
    
}

-(UIView *)floatView{
    
    if (_floatView == nil) {
        _floatView = [[UIView alloc]initWithFrame:CGRectZero];
    }
    return _floatView;
}


-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    
    return self;
    
}


-(void)setModel:(HBQsmListModel *)model{
    
    _model = model;
    
    self.floatLabel.text = model.name;
    
}


-(void)setupUI{
    
    [self.contentView addSubview:self.floatView];
    
    [self.contentView addSubview:self.floatLabel];
    
    
    [self.floatView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.left.width.equalTo(self.contentView);
        make.height.mas_equalTo(15);
        
    }];
    
    [self.floatLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.floatView.mas_centerY);
        make.left.equalTo(self.contentView).offset(5);
        
    }];
    
    
}


@end
